// 设置初始化的值
const initNum = 0;
export default function countReducer(preState=0,action){
    const {type,data}  = action;
    switch (type) {
        case 'increment':
            debugger
            return preState + data*1;        
        case 'decrement':
            return preState - data*1;
        default:
            return initNum;
    }
} 